home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 2
/
Gold Medal Software Volume 2 (Gold Medal) (1994).iso
/
prog
/
gfact20e.arj
/
JACKDEMO.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-09-12
|
2KB
|
75 lines
DECLARE SUB DELAY (SECONDS!)
REM JACK DEMO
REM COPYRIGHT 1993 JAMES A. SAUSVILLE
REM ALL RIGHTS RESERVED
REM THIS DEMO IS DISTRIBUTED AS A PART OF THE GRAPHICS FACTORY 2.0
REM IT IS INTENDED TO SHOW HOW GRAPHICS MAY BE USED IN YOUR OWN PROGRAMS.
SCREEN 9
REM PLEASE NOTE THIS PROGRAM CONTAINS NO ERROR TRAPPING
REM THE SET FILE MAY BE USED TO CHANGE THE PALETTE AND DIMENTION THE STORAGE
REM ARRAY FOR THE GRAPHICS
DIM SET%(19)
FILE$ = "JACKDEMO.SET"
DEF SEG = VARSEG(SET%(0))
BLOAD FILE$, VARPTR(SET%(0))
DEF SEG
NUMFRAMES% = SET%(0) ' THE NUMBER OF GRAPHICS STORED
ELEMENTS% = SET%(3) ' THE SIZE/OFFSET OF THE GRAPHICS
REM CHANGE THE PALETTE TO THE ONE STORED IN THE SET FILE
DIM CURPAL%(15)
FOR LLL = 0 TO 15
CURPAL%(LLL) = SET%(4 + LLL)
NEXT LLL
PALETTE USING CURPAL%
REM DIMENSION THE ARRAY FOR THE GRAPHICS
DIM JACK%(NUMFRAMES% * ELEMENTS%)
FILE$ = "JACKDEMO.GF"
DEF SEG = VARSEG(JACK%(0))
BLOAD FILE$, VARPTR(JACK%(0))
DEF SEG
REM DEFINE AN ANIMATION SEQUENCE FOR THE FRAMES.
REM THE TWO DIGIT NUMBER IN THE STRING IS THE FRAME TO DISPLAY
A$ = "01 01 02 02 03 03 04 04 01 01 02 02 03 03 04 04 01 01 02 02 03 03 04 "
B$ = "04 01 01 02 02 03 03 04 04 05 06 07 08 09 10 11 12 13 14 15 16 17 17 "
C$ = "16 16 17 17 16 16 17 17 16 16 17 17 17 17 17 "
ANIM$ = A$ + B$ + C$
REM MAIN ANIMATION LOOP
DO WHILE (1)
FOR LLL = 1 TO LEN(ANIM$) STEP 3
FRAME$ = MID$(ANIM$, LLL, 2)
FRAME% = VAL(FRAME$)
PUT (300, 175), JACK%((FRAME% - 1) * ELEMENTS%), PSET
K$ = INKEY$ 'READ THE KEYBOARD
IF K$ = " " THEN END 'END IF [SPACE] IS PRESSED
CALL DELAY(.2)
NEXT LLL
LOOP
END
SUB DELAY (SECONDS!)
TIME = TIMER
XDELAY = TIME + SECONDS
WHILE NOT (TIMER > XDELAY)
WEND
END SUB